package com.wims.client;

/**
 * This class is here mostly for documentation purposes. The idea for organizing
 * the GUI is as follows:
 * <ul>
 * <li>Divs for all pages are defined in the main HTML file. Layout and styling
 * are done in the HTML</li>
 * <li>Contents of each page is organized in page wrapper classes. Each page
 * wrapper contains a bunch of widgets and hooks them up to the HTML</li>
 * <li>A page wrapper gets a reference to the main structure for flipping pages.
 * Page wrapper also somehow gets a pointer to the service.</li>
 * <li>Main class has a list of names for all pages and one method to flip them</li>
 * <li>Page wrappers have final static String field for page name</li>
 * </ul>
 * 
 * @author Tatiana
 */
public abstract class PageWrapper {
	protected PageHolder holder;

	/**
	 * Shared constructor part.
	 * 
	 * @param holder
	 *            reference to the main page
	 */
	public PageWrapper(PageHolder holder) {
		this.holder = holder;
		// May be a good idea to make the holder call createUI after all
		// constructors are done. Let's see how page development goes.
		createUI();
	}

	/**
	 * @return the name of the HTML element corresponding to this screen. Should
	 *         match the static constant
	 */
	public abstract String getPageName();

	/** Create UI elements and connect them to the main HTML */
	protected abstract void createUI();
}
